import logging
import yagmail
#发送日志和报告
def log_set():
    logging.basicConfig(level=logging.DEBUG,format='%(levelname)s-%(pathname)s',filename='log.txt')
def send_mail(filename):
    mail=yagmail.SMTP(user='3083843868@qq.com',password='rtdqshuuutvadfde',host='smtp.qq.com')
    mail.send(to='3083843868@qq.com',subject='测试报告',contents='这是一种警告',attachments=filename)